# Maintainer: Levente Polyak <anthraxx[at]archlinux[dot]org>
# Contributor: Randy Heydon <randy.heydon at clockworklab dot net>

pkgname=xdot
_pkgname=${pkgname}.py
pkgver=1.2
pkgrel=3
pkgdesc="Interactive viewer for graphs written in Graphviz's dot language"
url='https://github.com/jrfonseca/xdot.py'
arch=('any')
license=('LGPL2.1')
depends=('graphviz' 'gtk3' 'python' 'python-cairo' 'python-gobject' 'python-numpy')
makedepends=('python-build' 'python-installer' 'python-setuptools' 'python-wheel')
checkdepends=('xorg-server-xvfb')
source=(${pkgname}-${pkgver}.tar.gz::https://github.com/jrfonseca/${_pkgname}/archive/${pkgver}.tar.gz
        xdot.desktop)
sha512sums=('b4d3b15114b982c7c38cc71c0602f6d1ba9874c7315c2b8c4a8a48bf7674e9b38bf19a0d4a2d319acc9a29cf8f177a651d4e213761e88b0b3cb26e95e8a92dda'
            '7bd7994f03c4d7634a9ab780423f1e9d647df0836fd6d8f825dc0bac6ad506ad44457ba473367d1a16b89d00f441c730cb2b66cb5c300542addcf622be82c867')

build() {
  cd ${_pkgname}-${pkgver}
  python -m build --wheel --no-isolation
}

check() {
  cd ${_pkgname}-${pkgver}
  xvfb-run python test.py
}

package() {
  cd ${_pkgname}-${pkgver}
  python -m installer --destdir="$pkgdir" dist/*.whl
  install -Dm 644 ../xdot.desktop -t "${pkgdir}/usr/share/applications"
}

# vim: ts=2 sw=2 et:
